package com.skt.exception;

import lombok.Getter;

@Getter
public enum ValidationErrorCode implements ErrorCode {

    // ========== 通用参数错误 (20xxx) ==========
    PARAM_INVALID(20001, "参数校验失败"),
    FIELD_REQUIRED(20002, "字段不能为空"),
    FIELD_LENGTH_INVALID(20003, "字段长度无效"),
    FIELD_FORMAT_INVALID(20004, "字段格式无效"),

    // ========== 用户相关参数 (201xx) ==========
    USERNAME_EMPTY(20101, "用户名不能为空"),
    USERNAME_LENGTH_INVALID(20102, "用户名长度3-20个字符"),
    USERNAME_FORMAT_INVALID(20103, "用户名只能包含字母、数字、下划线"),

    PASSWORD_EMPTY(20111, "密码不能为空"),
    PASSWORD_LENGTH_INVALID(20112, "密码长度6-20个字符"),
    PASSWORD_FORMAT_INVALID(20113, "密码需包含字母和数字"),

    EMAIL_EMPTY(20121, "邮箱不能为空"),
    EMAIL_FORMAT_INVALID(20122, "邮箱格式无效"),

    PHONE_EMPTY(20131, "手机号不能为空"),
    PHONE_FORMAT_INVALID(20132, "手机号格式无效"),

    REALNAME_EMPTY(20141, "真实姓名不能为空"),
    REALNAME_LENGTH_INVALID(20142, "真实姓名长度2-10个字符"),

    // ========== 新增：忘记密码参数校验 (2015x) ==========
    EMAIL_OR_PHONE_REQUIRED(20151, "邮箱或手机号至少提供一个"),
    EMAIL_AND_PHONE_CONFLICT(20152, "邮箱和手机号只能选择一个"),
    RESET_TOKEN_EMPTY(20153, "重置令牌不能为空"),
    RESET_TOKEN_FORMAT_INVALID(20154, "重置令牌格式无效"),

    // ========== 新增：通用增强 (2016x) ==========
    PARAM_MUTUALLY_EXCLUSIVE(20161, "参数互斥，只能选择一个"),
    PARAM_CONFLICT(20162, "参数冲突");

    private final int code;
    private final String message;

    ValidationErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
}